package com.bigger.listener;

import com.bigger.constant.MqConstant;
import com.bigger.service.BusinessService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MqXHDNListener {//这里命名不规范，应该为MqBusinessListener
    @Autowired
    private BusinessService businessService;

    @RabbitListener(
            queues = MqConstant.XHDN_INSERT_QUEUE
    )
    public void listenXHDNInsertOrUpdate(Long id){
        businessService.insertById(id);
    }

    @RabbitListener(
            queues = MqConstant.XHDN_DELETE_QUEUE
    )
    public void listenXHDNDelete(Long id){
        businessService.deleteById(id);
    }


}
